﻿using System.Collections.Generic;
using System.ComponentModel;
using Koonsoft.HYCRM.DAL;
using Koonsoft.HYCRM.Model;

namespace Koonsoft.HYCRM.BLL
{
    [DataObject]
    public class DelegateBLL
    {
        private DelegateDAL _dal = null;

        protected DelegateDAL DAL
        {
            get
            {
                if (_dal == null)
                {
                    _dal = new DelegateDAL();
                }

                return _dal;
            }
        }

        public string GetDelegateNameByDelegateType(int delegateType)
        {
            return DAL.GetDelegateNameByDelegateType(delegateType);
        }

        /// <summary>
        /// 获取所有业务类型
        /// </summary>
        /// <returns></returns>
        public List<DelegateInfo> GetDelegates()
        {
            return DAL.GetDelegates();
        }

        /// <summary>
        /// 根据权限获取业务类型
        /// </summary>
        /// <param name="roleID"></param>
        /// <param name="deliverType"></param>
        /// <returns></returns>
        public List<DelegateInfo> GetDelegatesByRoleID(int roleID, int deliverType)
        {
            return DAL.GetDelegatesByRoleID(roleID, deliverType);
        }

    }
}
